const koa = require("koa");
const app = new koa();
const router = require("koa-router")();
const cors = require("koa2-cors");
const run = require("./reptile/index");
// ctx上下文环境 包含req,res
router.get("/",async ctx=>{
    let res = await run();
    ctx.body = res;
})
router.get("/detail",async ctx=>{
    ctx.body = "detail"
})
app.use(cors());
app.use(router.routes());
app.listen(8000);
// ctrl+c  退出命令行